1. Field of the Invention
The present invention relates generally to an apparatus and method for transmitting and receiving files in a general purpose device, and more particularly, to an apparatus and method for transmitting and receiving files, while maintaining a file container structure.
2. Description of the Related Art
Typically, a general purpose device refers to a device that is not used for a specific purpose, but instead may be used for many general purposes, and may freely interwork with other general purpose devices for general purposes. The general purpose device may freely exchange files with other general purpose devices, for, e.g., file sharing.
In general purpose devices, files are stored or written based on a container structure such as a tree structure. As the content viewed, stored, and edited on general purpose devices is increasingly diversified, the container structure in which files are stored becomes more and more important. For this reason, during file transfer between general purpose devices, the receiving general purpose device must store any files it receives in accordance with the exact container structure in which those files were stored in the sending device.
FIG. 1 illustrates an example of a container structure for storing files.
The container structure illustrated in FIG. 1 is comprised of root directory ‘/’ 110, and its sub directories ‘A’ 112, ‘B’ 114, and ‘C’ 116. Directory ‘A’ 112 is a child directory that has root directory 110 as its parent directory. Directory ‘B’ 114 is a child directory that has directory ‘A’ 112 as its parent directory. Directory ‘C’ 116 is a child directory that has directory ‘B’ 114 as its parent directory.
Although each parent directory is coupled to a single child directory in FIG. 1, the container structure may be configured in various other forms, in which, e.g., multiple child directories are coupled to one parent directory.
In FIG. 1, file #1 120 is recorded in root directory 110, file #2 122 is recorded in directory ‘A’ 112, and file #3 124 is recorded in directory ‘B’ 114.
In order for a general purpose device to transfer files that are stored in a container structure like FIG. 1 to another general purpose device, the sending general purpose device must send both information about the container structure and the files which are to be stored in the container structure to the receiving general purpose device.
The receiving general purpose device configures a container in which it will store the files, based on the information about the container structure which it received from the sending general purpose device, and stores the received data for the files in the corresponding directory or directories in the configured container structure. In this way, the receiving general purpose device stores the files in the same container structure as the sending general purpose device.
FIG. 2 illustrates an example of conventional signal processing for file transfer between general purpose devices. In the signal processing example illustrated in FIG. 2, the files stored in the container structure illustrated in FIG. 1 are being transferred.
Referring to FIG. 2, the sending general purpose device (‘sender’) 10 transmits the file recorded in each directory to the receiving general purpose device (‘receiver’) 20 (see transmission of file #1 in step 210, file #2 in step 220, and file #3 in step 230). After transmitting each file, sender 10 transmits control information for creating the directory in which the transmitted file is to be stored (see transmission of ‘mkdir’ command in steps 212, 222 and 232), and then transmits control information for changing or moving to the directory in which the transmitted file is to be stored (see transmission of ‘ckdir’ command in steps 214, 224 and 234).
Thus, every time it transmits one file, sender 10 must also transmit control information about the directory receiver 20 will need to create, and control information so that receiver 20 will move or change to the directory it will store the transmitted file in.
As specifically shown in FIG. 1, sender 10 sequentially transmits file #1 120, file #2 122 and file #3 124.
First, sender 10 transmits file #1 120 in step 210, transmits control information to create root directory ‘/’ 110 (‘mkdir /’) in which file #1 120 will be stored in step 212, and then transmits control information for receiver 20 to move to the root directory ‘/’ 110 (‘chdir /’) in which file #1 120 will be stored in step 214. Conversely, receiver 20 receives file #120 in step 210, creates root directory ‘/’ 110 for storing received file #1 120 in step 212, and moves to root directory ‘/’ 110 to store received file #1 120 therein in step 214.
Second, sender 10 transmits file #2 122 in step 220, transmits control information to create directory ‘A’ 112 (‘mkdir A’) for storing file #2 122 in step 222, and transmits control information for receiver 20 to move to directory ‘A’ 112 (‘chdir A’) for storing file #2 122 in step 224. Conversely, receiver 20 receives file #2 122 in step 220, creates directory ‘A’ 112 for storing received file #2 122 in step 222, and moves to directory ‘A’ 112 for storing received file #2 122 therein, in step 224.
Third, sender 10 transmits file #3 124 in step 230, transmits control information to create directory ‘B’ 114 (‘mkdir B’) for storing file #3 124 in step 232, and transmits control information for receiver 20 to move to directory ‘B’ 114 (‘chdir B’) for storing file #3 124 in step 234.
Conversely, receiver 20 receives file #3 124 in step 230, creates directory ‘B’ 114 for storing received file #3 124 in step 232, and moves to directory ‘B’ 114 for storing received file #3 124 therein in step 234.
A protocol that could be used for transmitting and receiving files in accordance with the procedure illustrated in FIG. 2 is the File Transfer Protocol (FTP) (IETF RFC 765).
When the container structure is more complicated, the amount of control information that the sender has to provide to the receiver in the procedure illustrated in FIG. 2 increases.
FIG. 3 illustrates another example of conventional signal processing for file transfer between general purpose devices. The files stored in the container structure illustrated in FIG. 1 are being transferred in FIG. 3.
In the example illustrated in FIG. 3, the sender provides, in advance to the receiver, information about the location (for example, a Uniform Resource Locator (URL)) where content to be delivered can be acquired, as well as information about the container structure, and the receiver stores the received files in a container structure replicated using the information received in advance.
Referring to FIG. 3, sender 10 configures a metadata file including information about the content to be transmitted and the container structure, and transmits the configured metadata file to receiver 20 in step 310. The metadata file may include information about the location (for example, the URL) where at least one file corresponding to the content to be delivered is stored, and information about the container structure.
Receiver 20 acquires the location information corresponding to each of the three files (file #1 120, file #2 122 and file #3 124) to be received, and information about the container structure in which the files are to be stored, from the metadata file received from sender 10.
First, receiver 20 retrieves file #1 120 using the acquired location information, and then stores it in root directory ‘/’ 110 based on the acquired information about the container structure in step 312.
Second, the receiver 20 retrieves file #2 122 using the acquired location information, and stores it in directory ‘A’ 112 based on the acquired information about the container structure in step 314.
Third, the receiver 20 retrieves file #3 124 using the acquired location information, and stores it in directory ‘B’ 114 based on the acquired information about the container structure in step 316.
Although receiver 20 in FIG. 3 retrieves files from sender 10, it will be apparent to those of ordinary skill in the art that receiver 20 may retrieve desired files from other locations besides sender 10, such as from other general purpose devices.
Alternatively, receiver 20 may store the received files in accordance with another container structure, ignoring the information about the container structure which sender 10 has transmitted, depending on how receiver 20 is implemented.
In the procedure illustrated in FIG. 3, receiver 20 can determine, before the files are actually transmitted, in which container structure the files will be stored, thus allowing its user to identify the files and determine whether to accept the file transmission, before the actual file transmission starts.
However, in the conventional method in FIG. 3, sender 10 must use processing resources to both generate content and generate information about the container structure holding that content; when the container structure of the content to be transmitted is complicated and/or if there is a lot of content, such extra processing may cause unnecessary time delays.